import { computed, defineComponent, ref, watchEffect } from "vue";
import { useStore } from "vuex";

export default defineComponent({
  setup() {
    const store = useStore();

    const count = computed(() => {
      return store.state.loading.count;
    });

    const show = ref(false);
  
    watchEffect(() => {
      show.value = count.value > 0 ? true : false;
    });

    return () => (
      <div class="loadingContainer" v-show={show.value}>
        <a-spin size="large" />
      </div>
    );
  },
});
